package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.Vo.LikeEachOtherVo;
import com.example.Vo.UserAnswerVo;
import com.example.pojo.User;
import com.example.pojo.UserAnswerProblem;
import com.example.pojo.UserInstall;
import com.example.pojo.UserLike;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author liguoping
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    boolean updateUser(@Param("user") User user, @Param("id") String id);

    User findUserByPhone(@Param("phone") String phone);

    boolean updatePhone(@Param("NewPhone") String NewPhone, @Param("id") String id);

    boolean addUserInstall(@Param("userInstall") UserInstall userInstall);


    boolean addProblem(@Param("problem") String problem, @Param("id") String id);

    boolean addAnswerProblem(@Param("userAnswerProblem") UserAnswerProblem userAnswerProblem);

    UserAnswerVo findAnswerProblenById(@Param("id") String id);

    boolean updateInstall(@Param("like") Integer like,
                          @Param("comment") Integer comment,
                          @Param("announcement") Integer announcement,
                          @Param("id") String id,
                          @Param("name") String name);

    boolean setLike(@Param("userLike") UserLike userLike);

    List<LikeEachOtherVo> getLikeEanOther(@Param("id") String id);

    boolean cancelLike(@Param("userId") String userId, @Param("likeId") String likeId);

    List<LikeEachOtherVo> getLike(@Param("userId") String userId);

    List<LikeEachOtherVo> getFans(@Param("userId") String userId);

    UserInstall findProblem(@Param("userId") String userId);

}
